'''
31
3584229390681 15
'''
x = int(input())
i = 1
while True:
    if int('1' * i) % x == 0:
        print(int('1' * i) // x, i)
        break
    else:
        i += 1